package com.sais.manage.boot.repair.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.sais.manage.boot.building.dto.RoomDTO;
import com.sais.common.dto.BaseDTO;
import com.sais.manage.boot.repair.entity.Repair;
import com.sais.manage.boot.platform.entity.DictItem;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 宿舍管理平台-维修申请 DTO
 *
 * @author zwp
 * @date 2020/2/2
 */
@Data
@NoArgsConstructor
public class RepairDTO extends BaseDTO {

    private String ukId;
    private String name;
    private String code;
    private String roomId;
    private String phone;
    private String content;
    @JsonFormat(pattern = "yy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime comingTime;
    private Integer status;
    private Integer sort;

    private RoomDTO room;
    private List<DictItem> properties;

    public Repair convert() {
        Repair repair = new Repair();
        BeanUtils.copyProperties(this, repair);
        return repair;
    }

}
